//===----------------------------------------------------------------------===//
//
// This source file is part of the Soto for AWS open source project
//
// Copyright (c) 2017-2024 the Soto project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
// See CONTRIBUTORS.txt for the list of Soto project authors
//
// SPDX-License-Identifier: Apache-2.0
//
//===----------------------------------------------------------------------===//

// THIS FILE IS AUTOMATICALLY GENERATED by https://github.com/soto-project/soto-codegenerator.
// DO NOT EDIT.

#if canImport(FoundationEssentials)
import FoundationEssentials
#else
import Foundation
#endif
@_exported import SotoCore

/// Service object for interacting with AWS IVS service.
///
///  Introduction  The Amazon Interactive Video Service (IVS) API is REST compatible, using a standard HTTP API and an Amazon Web Services EventBridge event stream for responses. JSON is used for both requests and responses, including errors. The API is an Amazon Web Services regional service. For a list of supported regions and Amazon IVS HTTPS service endpoints, see the Amazon IVS page in the Amazon Web Services General Reference.   All API request parameters and URLs are case sensitive.    For a summary of notable documentation changes in each release, see  Document History.  Allowed Header Values      Accept: application/json     Accept-Encoding: gzip, deflate     Content-Type: application/json    Key Concepts     Channel — Stores configuration data related to your live stream. You first create a channel and then use the channel’s stream key to start your live stream.    Stream key — An identifier assigned by Amazon IVS when you create a channel, which is then used to authorize streaming.  Treat the stream key like a secret, since it allows anyone to stream to the channel.      Playback key pair — Video playback may be restricted using playback-authorization tokens, which use public-key encryption. A playback key pair is the public-private pair of keys used to sign and validate the playback-authorization token.    Recording configuration — Stores configuration related to recording a live stream and where to store the recorded content. Multiple channels can reference the same recording configuration.    Playback restriction policy — Restricts playback by countries and/or origin sites.   For more information about your IVS live stream, also see Getting Started with IVS Low-Latency Streaming.  Tagging  A tag is a metadata label that you assign to an Amazon Web Services resource. A tag comprises a key and a value, both set by you. For example, you might set a tag as topic:nature to label a particular video category. See Best practices and strategies in Tagging Amazon Web Services Resources and Tag Editor for details, including restrictions that apply to tags and "Tag naming limits and requirements"; Amazon IVS has no service-specific constraints beyond what is documented there. Tags can help you identify and organize your Amazon Web Services resources. For example, you can use the same tag for different resources to indicate that they are related. You can also use tags to manage access (see  Access Tags).  The Amazon IVS API has these tag-related operations: TagResource, UntagResource, and ListTagsForResource. The following resources support tagging: Channels, Stream Keys, Playback Key Pairs, and Recording Configurations. At most 50 tags can be applied to a resource.   Authentication versus Authorization  Note the differences between these concepts:    Authentication is about verifying identity. You need to be authenticated to sign Amazon IVS API requests.    Authorization is about granting permissions. Your IAM roles need to have permissions for Amazon IVS API requests. In addition, authorization is needed to view Amazon IVS private channels. (Private channels are channels that are enabled for "playback authorization.")    Authentication  All Amazon IVS API requests must be authenticated with a signature. The Amazon Web Services Command-Line Interface (CLI) and Amazon IVS Player SDKs take care of signing the underlying API calls for you. However, if your application calls the Amazon IVS API directly, it’s your responsibility to sign the requests. You generate a signature using valid Amazon Web Services credentials that have permission to perform the requested action. For example, you must sign PutMetadata requests with a signature generated from a user account that has the ivs:PutMetadata permission. For more information:   Authentication and generating signatures — See Authenticating Requests (Amazon Web Services Signature Version 4) in the Amazon Web Services General Reference.   Managing Amazon IVS permissions — See Identity and Access Management on the Security page of the Amazon IVS User Guide.    Amazon Resource Names (ARNs)  ARNs uniquely identify AWS resources. An ARN is required when you need to specify a resource unambiguously across all of AWS, such as in IAM policies and API calls. For more information, see Amazon Resource Names in the AWS General Reference.
public struct IVS: AWSService {
    // MARK: Member variables

    /// Client used for communication with AWS
    public let client: AWSClient
    /// Service configuration
    public let config: AWSServiceConfig

    // MARK: Initialization

    /// Initialize the IVS client
    /// - parameters:
    ///     - client: AWSClient used to process requests
    ///     - region: Region of server you want to communicate with. This will override the partition parameter.
    ///     - partition: AWS partition where service resides, standard (.aws), china (.awscn), government (.awsusgov).
    ///     - endpoint: Custom endpoint URL to use instead of standard AWS servers
    ///     - middleware: Middleware chain used to edit requests before they are sent and responses before they are decoded 
    ///     - timeout: Timeout value for HTTP requests
    ///     - byteBufferAllocator: Allocator for ByteBuffers
    ///     - options: Service options
    public init(
        client: AWSClient,
        region: SotoCore.Region? = nil,
        partition: AWSPartition = .aws,
        endpoint: String? = nil,
        middleware: AWSMiddlewareProtocol? = nil,
        timeout: TimeAmount? = nil,
        byteBufferAllocator: ByteBufferAllocator = ByteBufferAllocator(),
        options: AWSServiceConfig.Options = []
    ) {
        self.client = client
        self.config = AWSServiceConfig(
            region: region,
            partition: region?.partition ?? partition,
            serviceName: "IVS",
            serviceIdentifier: "ivs",
            serviceProtocol: .restjson,
            apiVersion: "2020-07-14",
            endpoint: endpoint,
            errorType: IVSErrorType.self,
            middleware: middleware,
            timeout: timeout,
            byteBufferAllocator: byteBufferAllocator,
            options: options
        )
    }





    // MARK: API Calls

    /// Performs GetChannel on multiple ARNs simultaneously.
    @Sendable
    @inlinable
    public func batchGetChannel(_ input: BatchGetChannelRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> BatchGetChannelResponse {
        try await self.client.execute(
            operation: "BatchGetChannel", 
            path: "/BatchGetChannel", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Performs GetChannel on multiple ARNs simultaneously.
    ///
    /// Parameters:
    ///   - arns: Array of ARNs, one per channel.
    ///   - logger: Logger use during operation
    @inlinable
    public func batchGetChannel(
        arns: [String],
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> BatchGetChannelResponse {
        let input = BatchGetChannelRequest(
            arns: arns
        )
        return try await self.batchGetChannel(input, logger: logger)
    }

    /// Performs GetStreamKey on multiple ARNs simultaneously.
    @Sendable
    @inlinable
    public func batchGetStreamKey(_ input: BatchGetStreamKeyRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> BatchGetStreamKeyResponse {
        try await self.client.execute(
            operation: "BatchGetStreamKey", 
            path: "/BatchGetStreamKey", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Performs GetStreamKey on multiple ARNs simultaneously.
    ///
    /// Parameters:
    ///   - arns: Array of ARNs, one per stream key.
    ///   - logger: Logger use during operation
    @inlinable
    public func batchGetStreamKey(
        arns: [String],
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> BatchGetStreamKeyResponse {
        let input = BatchGetStreamKeyRequest(
            arns: arns
        )
        return try await self.batchGetStreamKey(input, logger: logger)
    }

    /// Performs StartViewerSessionRevocation on multiple channel ARN and viewer ID pairs simultaneously.
    @Sendable
    @inlinable
    public func batchStartViewerSessionRevocation(_ input: BatchStartViewerSessionRevocationRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> BatchStartViewerSessionRevocationResponse {
        try await self.client.execute(
            operation: "BatchStartViewerSessionRevocation", 
            path: "/BatchStartViewerSessionRevocation", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Performs StartViewerSessionRevocation on multiple channel ARN and viewer ID pairs simultaneously.
    ///
    /// Parameters:
    ///   - viewerSessions: Array of viewer sessions, one per channel-ARN and viewer-ID pair.
    ///   - logger: Logger use during operation
    @inlinable
    public func batchStartViewerSessionRevocation(
        viewerSessions: [BatchStartViewerSessionRevocationViewerSession],
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> BatchStartViewerSessionRevocationResponse {
        let input = BatchStartViewerSessionRevocationRequest(
            viewerSessions: viewerSessions
        )
        return try await self.batchStartViewerSessionRevocation(input, logger: logger)
    }

    /// Creates a new channel and an associated stream key to start streaming.
    @Sendable
    @inlinable
    public func createChannel(_ input: CreateChannelRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> CreateChannelResponse {
        try await self.client.execute(
            operation: "CreateChannel", 
            path: "/CreateChannel", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Creates a new channel and an associated stream key to start streaming.
    ///
    /// Parameters:
    ///   - authorized: Whether the channel is private (enabled for playback authorization). Default: false.
    ///   - containerFormat: Indicates which content-packaging format is used (MPEG-TS or fMP4). If multitrackInputConfiguration is specified and enabled is true, then containerFormat is required and must be set to FRAGMENTED_MP4. Otherwise, containerFormat may be set to TS or FRAGMENTED_MP4. Default: TS.
    ///   - insecureIngest: Whether the channel allows insecure RTMP and SRT ingest. Default: false.
    ///   - latencyMode: Channel latency mode. Use NORMAL to broadcast and deliver live video up to Full HD. Use LOW for near-real-time interaction with viewers. Default: LOW.
    ///   - multitrackInputConfiguration: Object specifying multitrack input configuration. Default: no multitrack input configuration is specified.
    ///   - name: Channel name.
    ///   - playbackRestrictionPolicyArn: Playback-restriction-policy ARN. A valid ARN value here both specifies the ARN and enables playback restriction. Default: "" (empty string, no playback restriction policy is applied).
    ///   - preset: Optional transcode preset for the channel. This is selectable only for ADVANCED_HD and ADVANCED_SD channel types. For those channel types, the default preset is HIGHER_BANDWIDTH_DELIVERY. For other channel types (BASIC and STANDARD), preset is the empty string ("").
    ///   - recordingConfigurationArn: Recording-configuration ARN. A valid ARN value here both specifies the ARN and enables recording. Default: "" (empty string, recording is disabled).
    ///   - tags: Array of 1-50 maps, each of the form string:string (key:value). See Best practices and strategies in Tagging Amazon Web Services Resources and Tag Editor for details, including restrictions that apply to tags and "Tag naming limits and requirements"; Amazon IVS has no service-specific constraints beyond what is documented there.
    ///   - type: Channel type, which determines the allowable resolution and bitrate. If you exceed the allowable input resolution or bitrate, the stream probably will disconnect immediately. Default: STANDARD. For details, see Channel Types.
    ///   - logger: Logger use during operation
    @inlinable
    public func createChannel(
        authorized: Bool? = nil,
        containerFormat: ContainerFormat? = nil,
        insecureIngest: Bool? = nil,
        latencyMode: ChannelLatencyMode? = nil,
        multitrackInputConfiguration: MultitrackInputConfiguration? = nil,
        name: String? = nil,
        playbackRestrictionPolicyArn: String? = nil,
        preset: TranscodePreset? = nil,
        recordingConfigurationArn: String? = nil,
        tags: [String: String]? = nil,
        type: ChannelType? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> CreateChannelResponse {
        let input = CreateChannelRequest(
            authorized: authorized, 
            containerFormat: containerFormat, 
            insecureIngest: insecureIngest, 
            latencyMode: latencyMode, 
            multitrackInputConfiguration: multitrackInputConfiguration, 
            name: name, 
            playbackRestrictionPolicyArn: playbackRestrictionPolicyArn, 
            preset: preset, 
            recordingConfigurationArn: recordingConfigurationArn, 
            tags: tags, 
            type: type
        )
        return try await self.createChannel(input, logger: logger)
    }

    /// Creates a new playback restriction policy, for constraining playback by countries and/or origins.
    @Sendable
    @inlinable
    public func createPlaybackRestrictionPolicy(_ input: CreatePlaybackRestrictionPolicyRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> CreatePlaybackRestrictionPolicyResponse {
        try await self.client.execute(
            operation: "CreatePlaybackRestrictionPolicy", 
            path: "/CreatePlaybackRestrictionPolicy", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Creates a new playback restriction policy, for constraining playback by countries and/or origins.
    ///
    /// Parameters:
    ///   - allowedCountries: A list of country codes that control geoblocking restriction. Allowed values are the officially assigned ISO 3166-1 alpha-2 codes. Default: All countries (an empty array).
    ///   - allowedOrigins: A list of origin sites that control CORS restriction. Allowed values are the same as valid values of the Origin header defined at https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Origin. Default: All origins (an empty array).
    ///   - enableStrictOriginEnforcement: Whether channel playback is constrained by origin site. Default: false.
    ///   - name: Playback-restriction-policy name. The value does not need to be unique.
    ///   - tags: Array of 1-50 maps, each of the form string:string (key:value). See Best practices and strategies in Tagging Amazon Web Services Resources and Tag Editor for details, including restrictions that apply to tags and "Tag naming limits and requirements"; Amazon IVS has no service-specific constraints beyond what is documented there.
    ///   - logger: Logger use during operation
    @inlinable
    public func createPlaybackRestrictionPolicy(
        allowedCountries: [String]? = nil,
        allowedOrigins: [String]? = nil,
        enableStrictOriginEnforcement: Bool? = nil,
        name: String? = nil,
        tags: [String: String]? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> CreatePlaybackRestrictionPolicyResponse {
        let input = CreatePlaybackRestrictionPolicyRequest(
            allowedCountries: allowedCountries, 
            allowedOrigins: allowedOrigins, 
            enableStrictOriginEnforcement: enableStrictOriginEnforcement, 
            name: name, 
            tags: tags
        )
        return try await self.createPlaybackRestrictionPolicy(input, logger: logger)
    }

    /// Creates a new recording configuration, used to enable recording to Amazon S3.  Known issue: In the us-east-1 region, if you use the Amazon Web Services CLI to create a recording configuration, it returns success even if the S3 bucket is in a different region. In this case, the state of the recording configuration is CREATE_FAILED (instead of ACTIVE). (In other regions, the CLI correctly returns failure if the bucket is in a different region.)  Workaround: Ensure that your S3 bucket is in the same region as the recording configuration. If you create a recording configuration in a different region as your S3 bucket, delete that recording configuration and create a new one with an S3 bucket from the correct region.
    @Sendable
    @inlinable
    public func createRecordingConfiguration(_ input: CreateRecordingConfigurationRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> CreateRecordingConfigurationResponse {
        try await self.client.execute(
            operation: "CreateRecordingConfiguration", 
            path: "/CreateRecordingConfiguration", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Creates a new recording configuration, used to enable recording to Amazon S3.  Known issue: In the us-east-1 region, if you use the Amazon Web Services CLI to create a recording configuration, it returns success even if the S3 bucket is in a different region. In this case, the state of the recording configuration is CREATE_FAILED (instead of ACTIVE). (In other regions, the CLI correctly returns failure if the bucket is in a different region.)  Workaround: Ensure that your S3 bucket is in the same region as the recording configuration. If you create a recording configuration in a different region as your S3 bucket, delete that recording configuration and create a new one with an S3 bucket from the correct region.
    ///
    /// Parameters:
    ///   - destinationConfiguration: A complex type that contains a destination configuration for where recorded video will be stored.
    ///   - name: Recording-configuration name. The value does not need to be unique.
    ///   - recordingReconnectWindowSeconds: If a broadcast disconnects and then reconnects within the specified interval, the multiple streams will be considered a single broadcast and merged together. Default: 0.
    ///   - renditionConfiguration: Object that describes which renditions should be recorded for a stream.
    ///   - tags: Array of 1-50 maps, each of the form string:string (key:value). See Best practices and strategies in Tagging Amazon Web Services Resources and Tag Editor for details, including restrictions that apply to tags and "Tag naming limits and requirements"; Amazon IVS has no service-specific constraints beyond what is documented there.
    ///   - thumbnailConfiguration: A complex type that allows you to enable/disable the recording of thumbnails for a live session and modify the interval at which thumbnails are generated for the live session.
    ///   - logger: Logger use during operation
    @inlinable
    public func createRecordingConfiguration(
        destinationConfiguration: DestinationConfiguration,
        name: String? = nil,
        recordingReconnectWindowSeconds: Int? = nil,
        renditionConfiguration: RenditionConfiguration? = nil,
        tags: [String: String]? = nil,
        thumbnailConfiguration: ThumbnailConfiguration? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> CreateRecordingConfigurationResponse {
        let input = CreateRecordingConfigurationRequest(
            destinationConfiguration: destinationConfiguration, 
            name: name, 
            recordingReconnectWindowSeconds: recordingReconnectWindowSeconds, 
            renditionConfiguration: renditionConfiguration, 
            tags: tags, 
            thumbnailConfiguration: thumbnailConfiguration
        )
        return try await self.createRecordingConfiguration(input, logger: logger)
    }

    /// Creates a stream key, used to initiate a stream, for the specified channel ARN. Note that CreateChannel creates a stream key. If you subsequently use CreateStreamKey on the same channel, it will fail because a stream key already exists and there is a limit of 1 stream key per channel. To reset the stream key on a channel, use DeleteStreamKey and then CreateStreamKey.
    @Sendable
    @inlinable
    public func createStreamKey(_ input: CreateStreamKeyRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> CreateStreamKeyResponse {
        try await self.client.execute(
            operation: "CreateStreamKey", 
            path: "/CreateStreamKey", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Creates a stream key, used to initiate a stream, for the specified channel ARN. Note that CreateChannel creates a stream key. If you subsequently use CreateStreamKey on the same channel, it will fail because a stream key already exists and there is a limit of 1 stream key per channel. To reset the stream key on a channel, use DeleteStreamKey and then CreateStreamKey.
    ///
    /// Parameters:
    ///   - channelArn: ARN of the channel for which to create the stream key.
    ///   - tags: Array of 1-50 maps, each of the form string:string (key:value). See Best practices and strategies in Tagging Amazon Web Services Resources and Tag Editor for details, including restrictions that apply to tags and "Tag naming limits and requirements"; Amazon IVS has no service-specific constraints beyond what is documented there.
    ///   - logger: Logger use during operation
    @inlinable
    public func createStreamKey(
        channelArn: String,
        tags: [String: String]? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> CreateStreamKeyResponse {
        let input = CreateStreamKeyRequest(
            channelArn: channelArn, 
            tags: tags
        )
        return try await self.createStreamKey(input, logger: logger)
    }

    /// Deletes the specified channel and its associated stream keys. If you try to delete a live channel, you will get an error (409 ConflictException). To delete a channel that is live, call StopStream, wait for the Amazon EventBridge "Stream End" event (to verify that the stream's state is no longer Live), then call DeleteChannel. (See  Using EventBridge with Amazon IVS.)
    @Sendable
    @inlinable
    public func deleteChannel(_ input: DeleteChannelRequest, logger: Logger = AWSClient.loggingDisabled) async throws {
        try await self.client.execute(
            operation: "DeleteChannel", 
            path: "/DeleteChannel", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Deletes the specified channel and its associated stream keys. If you try to delete a live channel, you will get an error (409 ConflictException). To delete a channel that is live, call StopStream, wait for the Amazon EventBridge "Stream End" event (to verify that the stream's state is no longer Live), then call DeleteChannel. (See  Using EventBridge with Amazon IVS.)
    ///
    /// Parameters:
    ///   - arn: ARN of the channel to be deleted.
    ///   - logger: Logger use during operation
    @inlinable
    public func deleteChannel(
        arn: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws {
        let input = DeleteChannelRequest(
            arn: arn
        )
        return try await self.deleteChannel(input, logger: logger)
    }

    /// Deletes a specified authorization key pair. This invalidates future viewer tokens generated using the key pair’s privateKey. For more information, see Setting Up Private Channels in the Amazon IVS User Guide.
    @Sendable
    @inlinable
    public func deletePlaybackKeyPair(_ input: DeletePlaybackKeyPairRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> DeletePlaybackKeyPairResponse {
        try await self.client.execute(
            operation: "DeletePlaybackKeyPair", 
            path: "/DeletePlaybackKeyPair", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Deletes a specified authorization key pair. This invalidates future viewer tokens generated using the key pair’s privateKey. For more information, see Setting Up Private Channels in the Amazon IVS User Guide.
    ///
    /// Parameters:
    ///   - arn: ARN of the key pair to be deleted.
    ///   - logger: Logger use during operation
    @inlinable
    public func deletePlaybackKeyPair(
        arn: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> DeletePlaybackKeyPairResponse {
        let input = DeletePlaybackKeyPairRequest(
            arn: arn
        )
        return try await self.deletePlaybackKeyPair(input, logger: logger)
    }

    /// Deletes the specified playback restriction policy.
    @Sendable
    @inlinable
    public func deletePlaybackRestrictionPolicy(_ input: DeletePlaybackRestrictionPolicyRequest, logger: Logger = AWSClient.loggingDisabled) async throws {
        try await self.client.execute(
            operation: "DeletePlaybackRestrictionPolicy", 
            path: "/DeletePlaybackRestrictionPolicy", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Deletes the specified playback restriction policy.
    ///
    /// Parameters:
    ///   - arn: ARN of the playback restriction policy to be deleted.
    ///   - logger: Logger use during operation
    @inlinable
    public func deletePlaybackRestrictionPolicy(
        arn: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws {
        let input = DeletePlaybackRestrictionPolicyRequest(
            arn: arn
        )
        return try await self.deletePlaybackRestrictionPolicy(input, logger: logger)
    }

    /// Deletes the recording configuration for the specified ARN. If you try to delete a recording configuration that is associated with a channel, you will get an error (409 ConflictException). To avoid this, for all channels that reference the recording configuration, first use UpdateChannel to set the recordingConfigurationArn field to an empty string, then use DeleteRecordingConfiguration.
    @Sendable
    @inlinable
    public func deleteRecordingConfiguration(_ input: DeleteRecordingConfigurationRequest, logger: Logger = AWSClient.loggingDisabled) async throws {
        try await self.client.execute(
            operation: "DeleteRecordingConfiguration", 
            path: "/DeleteRecordingConfiguration", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Deletes the recording configuration for the specified ARN. If you try to delete a recording configuration that is associated with a channel, you will get an error (409 ConflictException). To avoid this, for all channels that reference the recording configuration, first use UpdateChannel to set the recordingConfigurationArn field to an empty string, then use DeleteRecordingConfiguration.
    ///
    /// Parameters:
    ///   - arn: ARN of the recording configuration to be deleted.
    ///   - logger: Logger use during operation
    @inlinable
    public func deleteRecordingConfiguration(
        arn: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws {
        let input = DeleteRecordingConfigurationRequest(
            arn: arn
        )
        return try await self.deleteRecordingConfiguration(input, logger: logger)
    }

    /// Deletes the stream key for the specified ARN, so it can no longer be used to stream.
    @Sendable
    @inlinable
    public func deleteStreamKey(_ input: DeleteStreamKeyRequest, logger: Logger = AWSClient.loggingDisabled) async throws {
        try await self.client.execute(
            operation: "DeleteStreamKey", 
            path: "/DeleteStreamKey", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Deletes the stream key for the specified ARN, so it can no longer be used to stream.
    ///
    /// Parameters:
    ///   - arn: ARN of the stream key to be deleted.
    ///   - logger: Logger use during operation
    @inlinable
    public func deleteStreamKey(
        arn: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws {
        let input = DeleteStreamKeyRequest(
            arn: arn
        )
        return try await self.deleteStreamKey(input, logger: logger)
    }

    /// Gets the channel configuration for the specified channel ARN. See also BatchGetChannel.
    @Sendable
    @inlinable
    public func getChannel(_ input: GetChannelRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> GetChannelResponse {
        try await self.client.execute(
            operation: "GetChannel", 
            path: "/GetChannel", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Gets the channel configuration for the specified channel ARN. See also BatchGetChannel.
    ///
    /// Parameters:
    ///   - arn: ARN of the channel for which the configuration is to be retrieved.
    ///   - logger: Logger use during operation
    @inlinable
    public func getChannel(
        arn: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> GetChannelResponse {
        let input = GetChannelRequest(
            arn: arn
        )
        return try await self.getChannel(input, logger: logger)
    }

    /// Gets a specified playback authorization key pair and returns the arn and fingerprint. The privateKey held by the caller can be used to generate viewer authorization tokens, to grant viewers access to private channels. For more information, see Setting Up Private Channels in the Amazon IVS User Guide.
    @Sendable
    @inlinable
    public func getPlaybackKeyPair(_ input: GetPlaybackKeyPairRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> GetPlaybackKeyPairResponse {
        try await self.client.execute(
            operation: "GetPlaybackKeyPair", 
            path: "/GetPlaybackKeyPair", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Gets a specified playback authorization key pair and returns the arn and fingerprint. The privateKey held by the caller can be used to generate viewer authorization tokens, to grant viewers access to private channels. For more information, see Setting Up Private Channels in the Amazon IVS User Guide.
    ///
    /// Parameters:
    ///   - arn: ARN of the key pair to be returned.
    ///   - logger: Logger use during operation
    @inlinable
    public func getPlaybackKeyPair(
        arn: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> GetPlaybackKeyPairResponse {
        let input = GetPlaybackKeyPairRequest(
            arn: arn
        )
        return try await self.getPlaybackKeyPair(input, logger: logger)
    }

    /// Gets the specified playback restriction policy.
    @Sendable
    @inlinable
    public func getPlaybackRestrictionPolicy(_ input: GetPlaybackRestrictionPolicyRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> GetPlaybackRestrictionPolicyResponse {
        try await self.client.execute(
            operation: "GetPlaybackRestrictionPolicy", 
            path: "/GetPlaybackRestrictionPolicy", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Gets the specified playback restriction policy.
    ///
    /// Parameters:
    ///   - arn: ARN of the playback restriction policy to be returned.
    ///   - logger: Logger use during operation
    @inlinable
    public func getPlaybackRestrictionPolicy(
        arn: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> GetPlaybackRestrictionPolicyResponse {
        let input = GetPlaybackRestrictionPolicyRequest(
            arn: arn
        )
        return try await self.getPlaybackRestrictionPolicy(input, logger: logger)
    }

    /// Gets the recording configuration for the specified ARN.
    @Sendable
    @inlinable
    public func getRecordingConfiguration(_ input: GetRecordingConfigurationRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> GetRecordingConfigurationResponse {
        try await self.client.execute(
            operation: "GetRecordingConfiguration", 
            path: "/GetRecordingConfiguration", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Gets the recording configuration for the specified ARN.
    ///
    /// Parameters:
    ///   - arn: ARN of the recording configuration to be retrieved.
    ///   - logger: Logger use during operation
    @inlinable
    public func getRecordingConfiguration(
        arn: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> GetRecordingConfigurationResponse {
        let input = GetRecordingConfigurationRequest(
            arn: arn
        )
        return try await self.getRecordingConfiguration(input, logger: logger)
    }

    /// Gets information about the active (live) stream on a specified channel.
    @Sendable
    @inlinable
    public func getStream(_ input: GetStreamRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> GetStreamResponse {
        try await self.client.execute(
            operation: "GetStream", 
            path: "/GetStream", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Gets information about the active (live) stream on a specified channel.
    ///
    /// Parameters:
    ///   - channelArn: Channel ARN for stream to be accessed.
    ///   - logger: Logger use during operation
    @inlinable
    public func getStream(
        channelArn: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> GetStreamResponse {
        let input = GetStreamRequest(
            channelArn: channelArn
        )
        return try await self.getStream(input, logger: logger)
    }

    /// Gets stream-key information for a specified ARN.
    @Sendable
    @inlinable
    public func getStreamKey(_ input: GetStreamKeyRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> GetStreamKeyResponse {
        try await self.client.execute(
            operation: "GetStreamKey", 
            path: "/GetStreamKey", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Gets stream-key information for a specified ARN.
    ///
    /// Parameters:
    ///   - arn: ARN for the stream key to be retrieved.
    ///   - logger: Logger use during operation
    @inlinable
    public func getStreamKey(
        arn: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> GetStreamKeyResponse {
        let input = GetStreamKeyRequest(
            arn: arn
        )
        return try await self.getStreamKey(input, logger: logger)
    }

    /// Gets metadata on a specified stream.
    @Sendable
    @inlinable
    public func getStreamSession(_ input: GetStreamSessionRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> GetStreamSessionResponse {
        try await self.client.execute(
            operation: "GetStreamSession", 
            path: "/GetStreamSession", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Gets metadata on a specified stream.
    ///
    /// Parameters:
    ///   - channelArn: ARN of the channel resource
    ///   - streamId: Unique identifier for a live or previously live stream in the specified channel. If no streamId is provided, this returns the most recent stream session for the channel, if it exists.
    ///   - logger: Logger use during operation
    @inlinable
    public func getStreamSession(
        channelArn: String,
        streamId: String? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> GetStreamSessionResponse {
        let input = GetStreamSessionRequest(
            channelArn: channelArn, 
            streamId: streamId
        )
        return try await self.getStreamSession(input, logger: logger)
    }

    /// Imports the public portion of a new key pair and returns its arn and fingerprint. The privateKey can then be used to generate viewer authorization tokens, to grant viewers access to private channels. For more information, see Setting Up Private Channels in the Amazon IVS User Guide.
    @Sendable
    @inlinable
    public func importPlaybackKeyPair(_ input: ImportPlaybackKeyPairRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> ImportPlaybackKeyPairResponse {
        try await self.client.execute(
            operation: "ImportPlaybackKeyPair", 
            path: "/ImportPlaybackKeyPair", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Imports the public portion of a new key pair and returns its arn and fingerprint. The privateKey can then be used to generate viewer authorization tokens, to grant viewers access to private channels. For more information, see Setting Up Private Channels in the Amazon IVS User Guide.
    ///
    /// Parameters:
    ///   - name: Playback-key-pair name. The value does not need to be unique.
    ///   - publicKeyMaterial: The public portion of a customer-generated key pair.
    ///   - tags: Any tags provided with the request are added to the playback key pair tags. See Best practices and strategies in Tagging Amazon Web Services Resources and Tag Editor for details, including restrictions that apply to tags and "Tag naming limits and requirements"; Amazon IVS has no service-specific constraints beyond what is documented there.
    ///   - logger: Logger use during operation
    @inlinable
    public func importPlaybackKeyPair(
        name: String? = nil,
        publicKeyMaterial: String,
        tags: [String: String]? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> ImportPlaybackKeyPairResponse {
        let input = ImportPlaybackKeyPairRequest(
            name: name, 
            publicKeyMaterial: publicKeyMaterial, 
            tags: tags
        )
        return try await self.importPlaybackKeyPair(input, logger: logger)
    }

    /// Gets summary information about all channels in your account, in the Amazon Web Services region where the API request is processed. This list can be filtered to match a specified name or recording-configuration ARN. Filters are mutually exclusive and cannot be used together. If you try to use both filters, you will get an error (409 ConflictException).
    @Sendable
    @inlinable
    public func listChannels(_ input: ListChannelsRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> ListChannelsResponse {
        try await self.client.execute(
            operation: "ListChannels", 
            path: "/ListChannels", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Gets summary information about all channels in your account, in the Amazon Web Services region where the API request is processed. This list can be filtered to match a specified name or recording-configuration ARN. Filters are mutually exclusive and cannot be used together. If you try to use both filters, you will get an error (409 ConflictException).
    ///
    /// Parameters:
    ///   - filterByName: Filters the channel list to match the specified name.
    ///   - filterByPlaybackRestrictionPolicyArn: Filters the channel list to match the specified policy.
    ///   - filterByRecordingConfigurationArn: Filters the channel list to match the specified recording-configuration ARN.
    ///   - maxResults: Maximum number of channels to return. Default: 100.
    ///   - nextToken: The first channel to retrieve. This is used for pagination; see the nextToken response field.
    ///   - logger: Logger use during operation
    @inlinable
    public func listChannels(
        filterByName: String? = nil,
        filterByPlaybackRestrictionPolicyArn: String? = nil,
        filterByRecordingConfigurationArn: String? = nil,
        maxResults: Int? = nil,
        nextToken: String? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> ListChannelsResponse {
        let input = ListChannelsRequest(
            filterByName: filterByName, 
            filterByPlaybackRestrictionPolicyArn: filterByPlaybackRestrictionPolicyArn, 
            filterByRecordingConfigurationArn: filterByRecordingConfigurationArn, 
            maxResults: maxResults, 
            nextToken: nextToken
        )
        return try await self.listChannels(input, logger: logger)
    }

    /// Gets summary information about playback key pairs. For more information, see Setting Up Private Channels in the Amazon IVS User Guide.
    @Sendable
    @inlinable
    public func listPlaybackKeyPairs(_ input: ListPlaybackKeyPairsRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> ListPlaybackKeyPairsResponse {
        try await self.client.execute(
            operation: "ListPlaybackKeyPairs", 
            path: "/ListPlaybackKeyPairs", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Gets summary information about playback key pairs. For more information, see Setting Up Private Channels in the Amazon IVS User Guide.
    ///
    /// Parameters:
    ///   - maxResults: Maximum number of key pairs to return. Default: your service quota or 100, whichever is smaller.
    ///   - nextToken: The first key pair to retrieve. This is used for pagination; see the nextToken response field.
    ///   - logger: Logger use during operation
    @inlinable
    public func listPlaybackKeyPairs(
        maxResults: Int? = nil,
        nextToken: String? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> ListPlaybackKeyPairsResponse {
        let input = ListPlaybackKeyPairsRequest(
            maxResults: maxResults, 
            nextToken: nextToken
        )
        return try await self.listPlaybackKeyPairs(input, logger: logger)
    }

    /// Gets summary information about playback restriction policies.
    @Sendable
    @inlinable
    public func listPlaybackRestrictionPolicies(_ input: ListPlaybackRestrictionPoliciesRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> ListPlaybackRestrictionPoliciesResponse {
        try await self.client.execute(
            operation: "ListPlaybackRestrictionPolicies", 
            path: "/ListPlaybackRestrictionPolicies", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Gets summary information about playback restriction policies.
    ///
    /// Parameters:
    ///   - maxResults: Maximum number of policies to return. Default: 1.
    ///   - nextToken: The first policy to retrieve. This is used for pagination; see the nextToken response field.
    ///   - logger: Logger use during operation
    @inlinable
    public func listPlaybackRestrictionPolicies(
        maxResults: Int? = nil,
        nextToken: String? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> ListPlaybackRestrictionPoliciesResponse {
        let input = ListPlaybackRestrictionPoliciesRequest(
            maxResults: maxResults, 
            nextToken: nextToken
        )
        return try await self.listPlaybackRestrictionPolicies(input, logger: logger)
    }

    /// Gets summary information about all recording configurations in your account, in the Amazon Web Services region where the API request is processed.
    @Sendable
    @inlinable
    public func listRecordingConfigurations(_ input: ListRecordingConfigurationsRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> ListRecordingConfigurationsResponse {
        try await self.client.execute(
            operation: "ListRecordingConfigurations", 
            path: "/ListRecordingConfigurations", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Gets summary information about all recording configurations in your account, in the Amazon Web Services region where the API request is processed.
    ///
    /// Parameters:
    ///   - maxResults: Maximum number of recording configurations to return. Default: your service quota or 100, whichever is smaller.
    ///   - nextToken: The first recording configuration to retrieve. This is used for pagination; see the nextToken response field.
    ///   - logger: Logger use during operation
    @inlinable
    public func listRecordingConfigurations(
        maxResults: Int? = nil,
        nextToken: String? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> ListRecordingConfigurationsResponse {
        let input = ListRecordingConfigurationsRequest(
            maxResults: maxResults, 
            nextToken: nextToken
        )
        return try await self.listRecordingConfigurations(input, logger: logger)
    }

    /// Gets summary information about stream keys for the specified channel.
    @Sendable
    @inlinable
    public func listStreamKeys(_ input: ListStreamKeysRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> ListStreamKeysResponse {
        try await self.client.execute(
            operation: "ListStreamKeys", 
            path: "/ListStreamKeys", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Gets summary information about stream keys for the specified channel.
    ///
    /// Parameters:
    ///   - channelArn: Channel ARN used to filter the list.
    ///   - maxResults: Maximum number of streamKeys to return. Default: 1.
    ///   - nextToken: The first stream key to retrieve. This is used for pagination; see the nextToken response field.
    ///   - logger: Logger use during operation
    @inlinable
    public func listStreamKeys(
        channelArn: String,
        maxResults: Int? = nil,
        nextToken: String? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> ListStreamKeysResponse {
        let input = ListStreamKeysRequest(
            channelArn: channelArn, 
            maxResults: maxResults, 
            nextToken: nextToken
        )
        return try await self.listStreamKeys(input, logger: logger)
    }

    /// Gets a summary of current and previous streams for a specified channel in your account, in the AWS region where the API request is processed.
    @Sendable
    @inlinable
    public func listStreamSessions(_ input: ListStreamSessionsRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> ListStreamSessionsResponse {
        try await self.client.execute(
            operation: "ListStreamSessions", 
            path: "/ListStreamSessions", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Gets a summary of current and previous streams for a specified channel in your account, in the AWS region where the API request is processed.
    ///
    /// Parameters:
    ///   - channelArn: Channel ARN used to filter the list.
    ///   - maxResults: Maximum number of streams to return. Default: 100.
    ///   - nextToken: The first stream to retrieve. This is used for pagination; see the nextToken response field.
    ///   - logger: Logger use during operation
    @inlinable
    public func listStreamSessions(
        channelArn: String,
        maxResults: Int? = nil,
        nextToken: String? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> ListStreamSessionsResponse {
        let input = ListStreamSessionsRequest(
            channelArn: channelArn, 
            maxResults: maxResults, 
            nextToken: nextToken
        )
        return try await self.listStreamSessions(input, logger: logger)
    }

    /// Gets summary information about live streams in your account, in the Amazon Web Services region where the API request is processed.
    @Sendable
    @inlinable
    public func listStreams(_ input: ListStreamsRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> ListStreamsResponse {
        try await self.client.execute(
            operation: "ListStreams", 
            path: "/ListStreams", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Gets summary information about live streams in your account, in the Amazon Web Services region where the API request is processed.
    ///
    /// Parameters:
    ///   - filterBy: Filters the stream list to match the specified criterion.
    ///   - maxResults: Maximum number of streams to return. Default: 100.
    ///   - nextToken: The first stream to retrieve. This is used for pagination; see the nextToken response field.
    ///   - logger: Logger use during operation
    @inlinable
    public func listStreams(
        filterBy: StreamFilters? = nil,
        maxResults: Int? = nil,
        nextToken: String? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> ListStreamsResponse {
        let input = ListStreamsRequest(
            filterBy: filterBy, 
            maxResults: maxResults, 
            nextToken: nextToken
        )
        return try await self.listStreams(input, logger: logger)
    }

    /// Gets information about Amazon Web Services tags for the specified ARN.
    @Sendable
    @inlinable
    public func listTagsForResource(_ input: ListTagsForResourceRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> ListTagsForResourceResponse {
        try await self.client.execute(
            operation: "ListTagsForResource", 
            path: "/tags/{resourceArn}", 
            httpMethod: .GET, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Gets information about Amazon Web Services tags for the specified ARN.
    ///
    /// Parameters:
    ///   - resourceArn: The ARN of the resource to be retrieved. The ARN must be URL-encoded.
    ///   - logger: Logger use during operation
    @inlinable
    public func listTagsForResource(
        resourceArn: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> ListTagsForResourceResponse {
        let input = ListTagsForResourceRequest(
            resourceArn: resourceArn
        )
        return try await self.listTagsForResource(input, logger: logger)
    }

    /// Inserts metadata into the active stream of the specified channel. At most 5 requests per second per channel are allowed, each with a maximum 1 KB payload. (If 5 TPS is not sufficient for your needs, we recommend batching your data into a single PutMetadata call.) At most 155 requests per second per account are allowed. Also see Embedding Metadata within a Video Stream in the Amazon IVS User Guide.
    @Sendable
    @inlinable
    public func putMetadata(_ input: PutMetadataRequest, logger: Logger = AWSClient.loggingDisabled) async throws {
        try await self.client.execute(
            operation: "PutMetadata", 
            path: "/PutMetadata", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Inserts metadata into the active stream of the specified channel. At most 5 requests per second per channel are allowed, each with a maximum 1 KB payload. (If 5 TPS is not sufficient for your needs, we recommend batching your data into a single PutMetadata call.) At most 155 requests per second per account are allowed. Also see Embedding Metadata within a Video Stream in the Amazon IVS User Guide.
    ///
    /// Parameters:
    ///   - channelArn: ARN of the channel into which metadata is inserted. This channel must have an active stream.
    ///   - metadata: Metadata to insert into the stream. Maximum: 1 KB per request.
    ///   - logger: Logger use during operation
    @inlinable
    public func putMetadata(
        channelArn: String,
        metadata: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws {
        let input = PutMetadataRequest(
            channelArn: channelArn, 
            metadata: metadata
        )
        return try await self.putMetadata(input, logger: logger)
    }

    /// Starts the process of revoking the viewer session associated with a specified channel ARN and viewer ID. Optionally, you can provide a version to revoke viewer sessions less than and including that version. For instructions on associating a viewer ID with a viewer session, see Setting Up Private Channels.
    @Sendable
    @inlinable
    public func startViewerSessionRevocation(_ input: StartViewerSessionRevocationRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> StartViewerSessionRevocationResponse {
        try await self.client.execute(
            operation: "StartViewerSessionRevocation", 
            path: "/StartViewerSessionRevocation", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Starts the process of revoking the viewer session associated with a specified channel ARN and viewer ID. Optionally, you can provide a version to revoke viewer sessions less than and including that version. For instructions on associating a viewer ID with a viewer session, see Setting Up Private Channels.
    ///
    /// Parameters:
    ///   - channelArn: The ARN of the channel associated with the viewer session to revoke.
    ///   - viewerId: The ID of the viewer associated with the viewer session to revoke. Do not use this field for personally identifying, confidential, or sensitive information.
    ///   - viewerSessionVersionsLessThanOrEqualTo: An optional filter on which versions of the viewer session to revoke. All versions less than or equal to the specified version will be revoked. Default: 0.
    ///   - logger: Logger use during operation
    @inlinable
    public func startViewerSessionRevocation(
        channelArn: String,
        viewerId: String,
        viewerSessionVersionsLessThanOrEqualTo: Int? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> StartViewerSessionRevocationResponse {
        let input = StartViewerSessionRevocationRequest(
            channelArn: channelArn, 
            viewerId: viewerId, 
            viewerSessionVersionsLessThanOrEqualTo: viewerSessionVersionsLessThanOrEqualTo
        )
        return try await self.startViewerSessionRevocation(input, logger: logger)
    }

    /// Disconnects the incoming RTMPS stream for the specified channel. Can be used in conjunction with DeleteStreamKey to prevent further streaming to a channel.  Many streaming client-software libraries automatically reconnect a dropped RTMPS session, so to stop the stream permanently, you may want to first revoke the streamKey attached to the channel.
    @Sendable
    @inlinable
    public func stopStream(_ input: StopStreamRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> StopStreamResponse {
        try await self.client.execute(
            operation: "StopStream", 
            path: "/StopStream", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Disconnects the incoming RTMPS stream for the specified channel. Can be used in conjunction with DeleteStreamKey to prevent further streaming to a channel.  Many streaming client-software libraries automatically reconnect a dropped RTMPS session, so to stop the stream permanently, you may want to first revoke the streamKey attached to the channel.
    ///
    /// Parameters:
    ///   - channelArn: ARN of the channel for which the stream is to be stopped.
    ///   - logger: Logger use during operation
    @inlinable
    public func stopStream(
        channelArn: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> StopStreamResponse {
        let input = StopStreamRequest(
            channelArn: channelArn
        )
        return try await self.stopStream(input, logger: logger)
    }

    /// Adds or updates tags for the Amazon Web Services resource with the specified ARN.
    @Sendable
    @inlinable
    public func tagResource(_ input: TagResourceRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> TagResourceResponse {
        try await self.client.execute(
            operation: "TagResource", 
            path: "/tags/{resourceArn}", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Adds or updates tags for the Amazon Web Services resource with the specified ARN.
    ///
    /// Parameters:
    ///   - resourceArn: ARN of the resource for which tags are to be added or updated. The ARN must be URL-encoded.
    ///   - tags: Array of tags to be added or updated. Array of maps, each of the form string:string (key:value). See Best practices and strategies in Tagging Amazon Web Services Resources and Tag Editor for details, including restrictions that apply to tags and "Tag naming limits and requirements"; Amazon IVS has no service-specific constraints beyond what is documented there.
    ///   - logger: Logger use during operation
    @inlinable
    public func tagResource(
        resourceArn: String,
        tags: [String: String],
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> TagResourceResponse {
        let input = TagResourceRequest(
            resourceArn: resourceArn, 
            tags: tags
        )
        return try await self.tagResource(input, logger: logger)
    }

    /// Removes tags from the resource with the specified ARN.
    @Sendable
    @inlinable
    public func untagResource(_ input: UntagResourceRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> UntagResourceResponse {
        try await self.client.execute(
            operation: "UntagResource", 
            path: "/tags/{resourceArn}", 
            httpMethod: .DELETE, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Removes tags from the resource with the specified ARN.
    ///
    /// Parameters:
    ///   - resourceArn: ARN of the resource for which tags are to be removed. The ARN must be URL-encoded.
    ///   - tagKeys: Array of tags to be removed. Array of maps, each of the form string:string (key:value). See Best practices and strategies in Tagging Amazon Web Services Resources and Tag Editor for details, including restrictions that apply to tags and "Tag naming limits and requirements"; Amazon IVS has no service-specific constraints beyond what is documented there.
    ///   - logger: Logger use during operation
    @inlinable
    public func untagResource(
        resourceArn: String,
        tagKeys: [String],
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> UntagResourceResponse {
        let input = UntagResourceRequest(
            resourceArn: resourceArn, 
            tagKeys: tagKeys
        )
        return try await self.untagResource(input, logger: logger)
    }

    /// Updates a channel's configuration. Live channels cannot be updated. You must stop the ongoing stream, update the channel, and restart the stream for the changes to take effect.
    @Sendable
    @inlinable
    public func updateChannel(_ input: UpdateChannelRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> UpdateChannelResponse {
        try await self.client.execute(
            operation: "UpdateChannel", 
            path: "/UpdateChannel", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Updates a channel's configuration. Live channels cannot be updated. You must stop the ongoing stream, update the channel, and restart the stream for the changes to take effect.
    ///
    /// Parameters:
    ///   - arn: ARN of the channel to be updated.
    ///   - authorized: Whether the channel is private (enabled for playback authorization).
    ///   - containerFormat: Indicates which content-packaging format is used (MPEG-TS or fMP4). If multitrackInputConfiguration is specified and enabled is true, then containerFormat is required and must be set to FRAGMENTED_MP4. Otherwise, containerFormat may be set to TS or FRAGMENTED_MP4. Default: TS.
    ///   - insecureIngest: Whether the channel allows insecure RTMP and SRT ingest. Default: false.
    ///   - latencyMode: Channel latency mode. Use NORMAL to broadcast and deliver live video up to Full HD. Use LOW for near-real-time interaction with viewers.
    ///   - multitrackInputConfiguration: Object specifying multitrack input configuration. Default: no multitrack input configuration is specified.
    ///   - name: Channel name.
    ///   - playbackRestrictionPolicyArn: Playback-restriction-policy ARN. A valid ARN value here both specifies the ARN and enables playback restriction. If this is set to an empty string, playback restriction policy is disabled.
    ///   - preset: Optional transcode preset for the channel. This is selectable only for ADVANCED_HD and ADVANCED_SD channel types. For those channel types, the default preset is HIGHER_BANDWIDTH_DELIVERY. For other channel types (BASIC and STANDARD), preset is the empty string ("").
    ///   - recordingConfigurationArn: Recording-configuration ARN. A valid ARN value here both specifies the ARN and enables recording. If this is set to an empty string, recording is disabled.
    ///   - type: Channel type, which determines the allowable resolution and bitrate. If you exceed the allowable input resolution or bitrate, the stream probably will disconnect immediately. Default: STANDARD. For details, see Channel Types.
    ///   - logger: Logger use during operation
    @inlinable
    public func updateChannel(
        arn: String,
        authorized: Bool? = nil,
        containerFormat: ContainerFormat? = nil,
        insecureIngest: Bool? = nil,
        latencyMode: ChannelLatencyMode? = nil,
        multitrackInputConfiguration: MultitrackInputConfiguration? = nil,
        name: String? = nil,
        playbackRestrictionPolicyArn: String? = nil,
        preset: TranscodePreset? = nil,
        recordingConfigurationArn: String? = nil,
        type: ChannelType? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> UpdateChannelResponse {
        let input = UpdateChannelRequest(
            arn: arn, 
            authorized: authorized, 
            containerFormat: containerFormat, 
            insecureIngest: insecureIngest, 
            latencyMode: latencyMode, 
            multitrackInputConfiguration: multitrackInputConfiguration, 
            name: name, 
            playbackRestrictionPolicyArn: playbackRestrictionPolicyArn, 
            preset: preset, 
            recordingConfigurationArn: recordingConfigurationArn, 
            type: type
        )
        return try await self.updateChannel(input, logger: logger)
    }

    /// Updates a specified playback restriction policy.
    @Sendable
    @inlinable
    public func updatePlaybackRestrictionPolicy(_ input: UpdatePlaybackRestrictionPolicyRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> UpdatePlaybackRestrictionPolicyResponse {
        try await self.client.execute(
            operation: "UpdatePlaybackRestrictionPolicy", 
            path: "/UpdatePlaybackRestrictionPolicy", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Updates a specified playback restriction policy.
    ///
    /// Parameters:
    ///   - allowedCountries: A list of country codes that control geoblocking restriction. Allowed values are the officially assigned ISO 3166-1 alpha-2 codes. Default: All countries (an empty array).
    ///   - allowedOrigins: A list of origin sites that control CORS restriction. Allowed values are the same as valid values of the Origin header defined at https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Origin. Default: All origins (an empty array).
    ///   - arn: ARN of the playback-restriction-policy to be updated.
    ///   - enableStrictOriginEnforcement: Whether channel playback is constrained by origin site. Default: false.
    ///   - name: Playback-restriction-policy name. The value does not need to be unique.
    ///   - logger: Logger use during operation
    @inlinable
    public func updatePlaybackRestrictionPolicy(
        allowedCountries: [String]? = nil,
        allowedOrigins: [String]? = nil,
        arn: String,
        enableStrictOriginEnforcement: Bool? = nil,
        name: String? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> UpdatePlaybackRestrictionPolicyResponse {
        let input = UpdatePlaybackRestrictionPolicyRequest(
            allowedCountries: allowedCountries, 
            allowedOrigins: allowedOrigins, 
            arn: arn, 
            enableStrictOriginEnforcement: enableStrictOriginEnforcement, 
            name: name
        )
        return try await self.updatePlaybackRestrictionPolicy(input, logger: logger)
    }
}

extension IVS {
    /// Initializer required by `AWSService.with(middlewares:timeout:byteBufferAllocator:options)`. You are not able to use this initializer directly as there are not public
    /// initializers for `AWSServiceConfig.Patch`. Please use `AWSService.with(middlewares:timeout:byteBufferAllocator:options)` instead.
    public init(from: IVS, patch: AWSServiceConfig.Patch) {
        self.client = from.client
        self.config = from.config.with(patch: patch)
    }
}

// MARK: Paginators

@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
extension IVS {
    /// Return PaginatorSequence for operation ``listChannels(_:logger:)``.
    ///
    /// - Parameters:
    ///   - input: Input for operation
    ///   - logger: Logger used for logging
    @inlinable
    public func listChannelsPaginator(
        _ input: ListChannelsRequest,
        logger: Logger = AWSClient.loggingDisabled
    ) -> AWSClient.PaginatorSequence<ListChannelsRequest, ListChannelsResponse> {
        return .init(
            input: input,
            command: self.listChannels,
            inputKey: \ListChannelsRequest.nextToken,
            outputKey: \ListChannelsResponse.nextToken,
            logger: logger
        )
    }
    /// Return PaginatorSequence for operation ``listChannels(_:logger:)``.
    ///
    /// - Parameters:
    ///   - filterByName: Filters the channel list to match the specified name.
    ///   - filterByPlaybackRestrictionPolicyArn: Filters the channel list to match the specified policy.
    ///   - filterByRecordingConfigurationArn: Filters the channel list to match the specified recording-configuration ARN.
    ///   - maxResults: Maximum number of channels to return. Default: 100.
    ///   - logger: Logger used for logging
    @inlinable
    public func listChannelsPaginator(
        filterByName: String? = nil,
        filterByPlaybackRestrictionPolicyArn: String? = nil,
        filterByRecordingConfigurationArn: String? = nil,
        maxResults: Int? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) -> AWSClient.PaginatorSequence<ListChannelsRequest, ListChannelsResponse> {
        let input = ListChannelsRequest(
            filterByName: filterByName, 
            filterByPlaybackRestrictionPolicyArn: filterByPlaybackRestrictionPolicyArn, 
            filterByRecordingConfigurationArn: filterByRecordingConfigurationArn, 
            maxResults: maxResults
        )
        return self.listChannelsPaginator(input, logger: logger)
    }

    /// Return PaginatorSequence for operation ``listPlaybackKeyPairs(_:logger:)``.
    ///
    /// - Parameters:
    ///   - input: Input for operation
    ///   - logger: Logger used for logging
    @inlinable
    public func listPlaybackKeyPairsPaginator(
        _ input: ListPlaybackKeyPairsRequest,
        logger: Logger = AWSClient.loggingDisabled
    ) -> AWSClient.PaginatorSequence<ListPlaybackKeyPairsRequest, ListPlaybackKeyPairsResponse> {
        return .init(
            input: input,
            command: self.listPlaybackKeyPairs,
            inputKey: \ListPlaybackKeyPairsRequest.nextToken,
            outputKey: \ListPlaybackKeyPairsResponse.nextToken,
            logger: logger
        )
    }
    /// Return PaginatorSequence for operation ``listPlaybackKeyPairs(_:logger:)``.
    ///
    /// - Parameters:
    ///   - maxResults: Maximum number of key pairs to return. Default: your service quota or 100, whichever is smaller.
    ///   - logger: Logger used for logging
    @inlinable
    public func listPlaybackKeyPairsPaginator(
        maxResults: Int? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) -> AWSClient.PaginatorSequence<ListPlaybackKeyPairsRequest, ListPlaybackKeyPairsResponse> {
        let input = ListPlaybackKeyPairsRequest(
            maxResults: maxResults
        )
        return self.listPlaybackKeyPairsPaginator(input, logger: logger)
    }

    /// Return PaginatorSequence for operation ``listPlaybackRestrictionPolicies(_:logger:)``.
    ///
    /// - Parameters:
    ///   - input: Input for operation
    ///   - logger: Logger used for logging
    @inlinable
    public func listPlaybackRestrictionPoliciesPaginator(
        _ input: ListPlaybackRestrictionPoliciesRequest,
        logger: Logger = AWSClient.loggingDisabled
    ) -> AWSClient.PaginatorSequence<ListPlaybackRestrictionPoliciesRequest, ListPlaybackRestrictionPoliciesResponse> {
        return .init(
            input: input,
            command: self.listPlaybackRestrictionPolicies,
            inputKey: \ListPlaybackRestrictionPoliciesRequest.nextToken,
            outputKey: \ListPlaybackRestrictionPoliciesResponse.nextToken,
            logger: logger
        )
    }
    /// Return PaginatorSequence for operation ``listPlaybackRestrictionPolicies(_:logger:)``.
    ///
    /// - Parameters:
    ///   - maxResults: Maximum number of policies to return. Default: 1.
    ///   - logger: Logger used for logging
    @inlinable
    public func listPlaybackRestrictionPoliciesPaginator(
        maxResults: Int? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) -> AWSClient.PaginatorSequence<ListPlaybackRestrictionPoliciesRequest, ListPlaybackRestrictionPoliciesResponse> {
        let input = ListPlaybackRestrictionPoliciesRequest(
            maxResults: maxResults
        )
        return self.listPlaybackRestrictionPoliciesPaginator(input, logger: logger)
    }

    /// Return PaginatorSequence for operation ``listRecordingConfigurations(_:logger:)``.
    ///
    /// - Parameters:
    ///   - input: Input for operation
    ///   - logger: Logger used for logging
    @inlinable
    public func listRecordingConfigurationsPaginator(
        _ input: ListRecordingConfigurationsRequest,
        logger: Logger = AWSClient.loggingDisabled
    ) -> AWSClient.PaginatorSequence<ListRecordingConfigurationsRequest, ListRecordingConfigurationsResponse> {
        return .init(
            input: input,
            command: self.listRecordingConfigurations,
            inputKey: \ListRecordingConfigurationsRequest.nextToken,
            outputKey: \ListRecordingConfigurationsResponse.nextToken,
            logger: logger
        )
    }
    /// Return PaginatorSequence for operation ``listRecordingConfigurations(_:logger:)``.
    ///
    /// - Parameters:
    ///   - maxResults: Maximum number of recording configurations to return. Default: your service quota or 100, whichever is smaller.
    ///   - logger: Logger used for logging
    @inlinable
    public func listRecordingConfigurationsPaginator(
        maxResults: Int? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) -> AWSClient.PaginatorSequence<ListRecordingConfigurationsRequest, ListRecordingConfigurationsResponse> {
        let input = ListRecordingConfigurationsRequest(
            maxResults: maxResults
        )
        return self.listRecordingConfigurationsPaginator(input, logger: logger)
    }

    /// Return PaginatorSequence for operation ``listStreamKeys(_:logger:)``.
    ///
    /// - Parameters:
    ///   - input: Input for operation
    ///   - logger: Logger used for logging
    @inlinable
    public func listStreamKeysPaginator(
        _ input: ListStreamKeysRequest,
        logger: Logger = AWSClient.loggingDisabled
    ) -> AWSClient.PaginatorSequence<ListStreamKeysRequest, ListStreamKeysResponse> {
        return .init(
            input: input,
            command: self.listStreamKeys,
            inputKey: \ListStreamKeysRequest.nextToken,
            outputKey: \ListStreamKeysResponse.nextToken,
            logger: logger
        )
    }
    /// Return PaginatorSequence for operation ``listStreamKeys(_:logger:)``.
    ///
    /// - Parameters:
    ///   - channelArn: Channel ARN used to filter the list.
    ///   - maxResults: Maximum number of streamKeys to return. Default: 1.
    ///   - logger: Logger used for logging
    @inlinable
    public func listStreamKeysPaginator(
        channelArn: String,
        maxResults: Int? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) -> AWSClient.PaginatorSequence<ListStreamKeysRequest, ListStreamKeysResponse> {
        let input = ListStreamKeysRequest(
            channelArn: channelArn, 
            maxResults: maxResults
        )
        return self.listStreamKeysPaginator(input, logger: logger)
    }

    /// Return PaginatorSequence for operation ``listStreamSessions(_:logger:)``.
    ///
    /// - Parameters:
    ///   - input: Input for operation
    ///   - logger: Logger used for logging
    @inlinable
    public func listStreamSessionsPaginator(
        _ input: ListStreamSessionsRequest,
        logger: Logger = AWSClient.loggingDisabled
    ) -> AWSClient.PaginatorSequence<ListStreamSessionsRequest, ListStreamSessionsResponse> {
        return .init(
            input: input,
            command: self.listStreamSessions,
            inputKey: \ListStreamSessionsRequest.nextToken,
            outputKey: \ListStreamSessionsResponse.nextToken,
            logger: logger
        )
    }
    /// Return PaginatorSequence for operation ``listStreamSessions(_:logger:)``.
    ///
    /// - Parameters:
    ///   - channelArn: Channel ARN used to filter the list.
    ///   - maxResults: Maximum number of streams to return. Default: 100.
    ///   - logger: Logger used for logging
    @inlinable
    public func listStreamSessionsPaginator(
        channelArn: String,
        maxResults: Int? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) -> AWSClient.PaginatorSequence<ListStreamSessionsRequest, ListStreamSessionsResponse> {
        let input = ListStreamSessionsRequest(
            channelArn: channelArn, 
            maxResults: maxResults
        )
        return self.listStreamSessionsPaginator(input, logger: logger)
    }

    /// Return PaginatorSequence for operation ``listStreams(_:logger:)``.
    ///
    /// - Parameters:
    ///   - input: Input for operation
    ///   - logger: Logger used for logging
    @inlinable
    public func listStreamsPaginator(
        _ input: ListStreamsRequest,
        logger: Logger = AWSClient.loggingDisabled
    ) -> AWSClient.PaginatorSequence<ListStreamsRequest, ListStreamsResponse> {
        return .init(
            input: input,
            command: self.listStreams,
            inputKey: \ListStreamsRequest.nextToken,
            outputKey: \ListStreamsResponse.nextToken,
            logger: logger
        )
    }
    /// Return PaginatorSequence for operation ``listStreams(_:logger:)``.
    ///
    /// - Parameters:
    ///   - filterBy: Filters the stream list to match the specified criterion.
    ///   - maxResults: Maximum number of streams to return. Default: 100.
    ///   - logger: Logger used for logging
    @inlinable
    public func listStreamsPaginator(
        filterBy: StreamFilters? = nil,
        maxResults: Int? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) -> AWSClient.PaginatorSequence<ListStreamsRequest, ListStreamsResponse> {
        let input = ListStreamsRequest(
            filterBy: filterBy, 
            maxResults: maxResults
        )
        return self.listStreamsPaginator(input, logger: logger)
    }
}

extension IVS.ListChannelsRequest: AWSPaginateToken {
    @inlinable
    public func usingPaginationToken(_ token: String) -> IVS.ListChannelsRequest {
        return .init(
            filterByName: self.filterByName,
            filterByPlaybackRestrictionPolicyArn: self.filterByPlaybackRestrictionPolicyArn,
            filterByRecordingConfigurationArn: self.filterByRecordingConfigurationArn,
            maxResults: self.maxResults,
            nextToken: token
        )
    }
}

extension IVS.ListPlaybackKeyPairsRequest: AWSPaginateToken {
    @inlinable
    public func usingPaginationToken(_ token: String) -> IVS.ListPlaybackKeyPairsRequest {
        return .init(
            maxResults: self.maxResults,
            nextToken: token
        )
    }
}

extension IVS.ListPlaybackRestrictionPoliciesRequest: AWSPaginateToken {
    @inlinable
    public func usingPaginationToken(_ token: String) -> IVS.ListPlaybackRestrictionPoliciesRequest {
        return .init(
            maxResults: self.maxResults,
            nextToken: token
        )
    }
}

extension IVS.ListRecordingConfigurationsRequest: AWSPaginateToken {
    @inlinable
    public func usingPaginationToken(_ token: String) -> IVS.ListRecordingConfigurationsRequest {
        return .init(
            maxResults: self.maxResults,
            nextToken: token
        )
    }
}

extension IVS.ListStreamKeysRequest: AWSPaginateToken {
    @inlinable
    public func usingPaginationToken(_ token: String) -> IVS.ListStreamKeysRequest {
        return .init(
            channelArn: self.channelArn,
            maxResults: self.maxResults,
            nextToken: token
        )
    }
}

extension IVS.ListStreamSessionsRequest: AWSPaginateToken {
    @inlinable
    public func usingPaginationToken(_ token: String) -> IVS.ListStreamSessionsRequest {
        return .init(
            channelArn: self.channelArn,
            maxResults: self.maxResults,
            nextToken: token
        )
    }
}

extension IVS.ListStreamsRequest: AWSPaginateToken {
    @inlinable
    public func usingPaginationToken(_ token: String) -> IVS.ListStreamsRequest {
        return .init(
            filterBy: self.filterBy,
            maxResults: self.maxResults,
            nextToken: token
        )
    }
}
